<template>
    <bi-form ref="form">
        <bi-form-item label="标题" prop="title">
            <bi-input v-model="form.title" required></bi-input>
        </bi-form-item>

        <bi-form-item label="名称" prop="name">
            <bi-input v-model="form.name"></bi-input>
        </bi-form-item>

        <bi-form-item label="描述" prop="description">
            <bi-textarea v-model="form.description"></bi-textarea>
        </bi-form-item>
        <!--        <bi-form-item label="状态" prop="status">
            <bi-radio v-model="form.status" :option="statusOption">
               
            </bi-radio>
        </bi-form-item>
        -->

    </bi-form>
</template>

<script>
export default{
    props:{
        item:Object
    },
    data(){

        let form = {
            page_id:'',
            title:'',
            name:'',
            description:'',
            status:'yes',
        }

        let statusOption = [
            {value:'yes',label:'启用'},
            {value:'no',label:'禁用'}
        ]

        form = this.$assign(form,this.item);
        return {
            form,
            statusOption
        }
    },

    methods:{
        dialogOk(){
            if (this.$refs.form.check()){
                this.$ajax({
                    url:this.$url({app:'shop','controller':'admin.page',action:'save'}),
                    data:this.form,
                    success:(data)=>{
                        this.dialog.callback();
                        this.dialog.close();
                    }
                })
            }

            return false;
        }
    }

}
</script>